    var urlinfo = window.location.href;
    var len = urlinfo.length;
    var offset = urlinfo.indexOf("?");
    var newsidinfo = urlinfo.substr(offset, len)
    var newsids = newsidinfo.split("=");
    var newsid = newsids[2];
    var path=newsid+'.jpg';
    // alert(path);
var camera, scene, renderer;
var fov=70, texture_placeholder, isUserInteracting=false,onPointerDownPointerX=0, dis=500,
    onPointerDownPointerY=0, lon=0, onPointerDownPointerLon=0, lat=0, onPointerDownPointerLat=0, phi=0,theta=0;
init();
animate();
function init(){
    renderer=new THREE.WebGLRenderer();
    renderer.setSize(window.innerWidth, window.innerHeight);
    var container=document.getElementById('container');
    container.appendChild(renderer.domElement);

    camera=new THREE.PerspectiveCamera(fov,window.innerWidth/window.innerHeight,1,3000);
    camera.target=new THREE.Vector3(0,0,0);

    var mesh=new THREE.Mesh(                                 
        new THREE.SphereGeometry(dis,60,40),
        new THREE.MeshBasicMaterial({map:THREE.ImageUtils.loadTexture("textures/"+path)})
    );
    mesh.scale.x=-1;

    scene=new THREE.Scene();
    scene.add(mesh);

    renderer.render(scene,camera);

    document.addEventListener('mousedown',onDocumentMouseDown,false);
    document.addEventListener('mousemove',onDocumentMouseMove,false);
    document.addEventListener('mouseup',onDocumentMouseUp,false);
    document.addEventListener('mousewheel',onDocumentMouseWheel,false);
    document.addEventListener('DOMMouseScroll',onDocumentMouseWheel,false);
    window.addEventListener('resize',onWindowResize,false);
}

function onWindowResize(){
    camera.aspect=window.innerWidth/window.innerHeight;
    camera.updateProjectionMatrix();
    renderer.setSize(window.innerWidth,window.innerHeight);
}

function onDocumentMouseDown(event){
    event.preventDefault();
    isUserInteracting=true;
    onPointerDownPointerX=event.clientX;
    onPointerDownPointerY=event.clientY;
    onPointerDownPointerLon=lon;
    onPointerDownPointerLat=lat;
}

function onDocumentMouseMove(event){
    if(isUserInteracting)
    {
        lon=(onPointerDownPointerX-event.clientX)*0.1+onPointerDownPointerLon;
        lat=(event.clientY-onPointerDownPointerY)*0.1+onPointerDownPointerLat;
    }
}

function onDocumentMouseUp(event)
{
    isUserInteracting=false;
}

function onDocumentMouseWheel(event)
{
    //WebKit
    if(event.wheelDeltaY)
    {
        fov -=event.wheelDeltaY*0.05;
    }
    else if(event.wheelDelta)
    {
        //Opera/Explorer 9
        fov -=event.wheelDelta*0.05;
    }
    else if(event.detail)
    {
        //Firefox
        fov +=event.detail*1.0;
    }
    camera.projectionMatrix.makePerspective(fov,window.innerWidth/window.innerHeight,1,1100);

    render();
}

function animate(){
    requestAnimationFrame(animate);
    render();
}

function render(){
    lat=Math.max(-85,Math.min(85,lat));
    phi=THREE.Math.degToRad(90-lat);
    theta=THREE.Math.degToRad(lon);
    camera.target.x=dis*Math.sin(phi)*Math.cos(theta);
    camera.target.y=dis*Math.cos(phi);
    camera.target.z=dis*Math.sin(phi)*Math.sin(theta);
    camera.lookAt(camera.target);
    renderer.render(scene,camera);
}